<!doctype html>
<html class="no-js" lang="">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title>新文章模块文档</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="icon" type="image/x-icon" href="../images/favicon.ico">
	    <link rel="stylesheet" href="../styles/style.css">
                 <link rel="stylesheet" href="../styles/postmark.css">
    </head>
    <body>

        <div class="navbar navbar-default navbar-fixed-top visible-xs">
            <a href="../" class="navbar-brand">新文章模块文档</a>
            <button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>
        </div>

        <div class="xs-menu menu" id="mobile-menu">
            <div id="book-search-input" role="search">
                <input type="text" placeholder="Type to search">
            </div>
            <nav>
            
                <ul class="list">
            
                    <li class="title">
                        <a href="../index.html">新文章模块文档</a>
                    </li>
            
                    <li class="divider"></li>
            
            
                    <li class="chapter">
                        <a data-type="chapter-link" href="../index.html"><span class="fa fa-home"></span>Getting started</a>
                        <ul class="links">
                                <li class="link">
                                    <a 
                                        
                                         href="../overview.html" 
                                         href="../overview.html" 
                                        >
                                        <span class="fa fa-th"></span>Overview
                                    </a>
                                </li>
                                <li class="link">
                                  <a href="../index.html" ><span class="fa fa-file-text-o"></span>README</a>
                                </li>
                        </ul>
                    </li>
            
            
                    <li class="chapter">
                        <a data-type="chapter-link" href="../modules.html" >
                            <div class="menu-toggler linked" data-toggle="collapse"
                                    data-target="#xs-modules-links"
                            >
                                <span class="fa fa-archive"></span>
                                <span class="link-name">Modules</span>
                                <span class="fa fa-angle-down"></span>
                            </div>
                        </a>
                        <ul class="links collapse "
                                id="xs-modules-links"
                            >
                                <li class="link">
                                    <a href="../modules/AppModule.html" >AppModule</a>
                                </li>
                        </ul>
                    </li>
            
                    <li class="chapter">
                        <div class="simple menu-toggler" data-toggle="collapse"
                                data-target="#xs-components-links"
                            >
                            <span class="fa fa-cogs"></span>
                            <span>Components</span>
                            <span class="fa fa-angle-down"></span>
                        </div>
                        <ul class="links collapse "
                                id="xs-components-links"
                            >
                                <li class="link">
                                    <a href="../components/AppComponent.html" >AppComponent</a>
                                </li>
                                <li class="link">
                                    <a href="../components/ArticleComponent.html" >ArticleComponent</a>
                                </li>
                                <li class="link">
                                    <a href="../components/HomeComponent.html" >HomeComponent</a>
                                </li>
                                <li class="link">
                                    <a href="../components/SearchComponent.html" >SearchComponent</a>
                                </li>
                        </ul>
                    </li>
            
            
                    <li class="chapter">
                        <div class="simple menu-toggler" data-toggle="collapse"
                                data-target="#xs-classes-links"
                            >
                            <span class="fa fa-file-code-o"></span>
                            <span>Classes</span>
                            <span class="fa fa-angle-down"></span>
                        </div>
                        <ul class="links collapse "
                                id="xs-classes-links"
                            >
                                <li class="link">
                                    <a href="../classes/Article.html"  data-type="entity-link" class="active" >Article</a>
                                </li>
                                <li class="link">
                                    <a href="../classes/Column.html" >Column</a>
                                </li>
                        </ul>
                    </li>
            
                    <li class="chapter">
                        <div class="simple menu-toggler" data-toggle="collapse"
                                data-target="#xs-injectables-links"
                            >
                            <span class="fa fa-long-arrow-down"></span>
                            <span>Injectables</span>
                            <span class="fa fa-angle-down"></span>
                        </div>
                        <ul class="links collapse "
                                id="xs-injectables-links"
                            >
                                <li class="link">
                                    <a href="../injectables/AppService.html" >AppService</a>
                                </li>
                                <li class="link">
                                    <a href="../injectables/ArticleListService.html" >ArticleListService</a>
                                </li>
                                <li class="link">
                                    <a href="../injectables/SmarketHttpService.html" >SmarketHttpService</a>
                                </li>
                        </ul>
                    </li>
            
            
            
            
                    <li class="chapter">
                        <div class="simple menu-toggler" data-toggle="collapse"
                                data-target="#xs-miscellaneous-links"
                            >
                            <span class="fa fa-cubes"></span>
                            <span>Miscellaneous</span>
                            <span class="fa fa-angle-down"></span>
                        </div>
                        <ul class="links collapse "
                                id="xs-miscellaneous-links"
                            >
                                <li class="link">
                                  <a href="../miscellaneous/variables.html" data-type="entity-link" >Variables</a>
                                </li>
                        </ul>
                    </li>
            
                    <li class="chapter">
                        <a data-type="chapter-link" href="../routes.html" ><span class="fa fa-code-fork"></span>Routes</a>
                    </li>
            
                    <li class="chapter">
                        <a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
                    </li>
            
            
                </ul>
            
            </nav>
        </div>

        <div class="container-fluid main">
           <div class="row main">
               <div class="hidden-xs menu">
                   <nav>
                   
                       <ul class="list">
                   
                           <li class="title">
                               <a href="../index.html">新文章模块文档</a>
                           </li>
                   
                           <li class="divider"></li>
                   
                               <div id="book-search-input" role="search">
                                   <input type="text" placeholder="Type to search">
                               </div>
                   
                           <li class="chapter">
                               <a data-type="chapter-link" href="../index.html"><span class="fa fa-home"></span>Getting started</a>
                               <ul class="links">
                                       <li class="link">
                                           <a 
                                               
                                                href="../overview.html" 
                                                href="../overview.html" 
                                               >
                                               <span class="fa fa-th"></span>Overview
                                           </a>
                                       </li>
                                       <li class="link">
                                         <a href="../index.html" ><span class="fa fa-file-text-o"></span>README</a>
                                       </li>
                               </ul>
                           </li>
                   
                   
                           <li class="chapter">
                               <a data-type="chapter-link" href="../modules.html" >
                                   <div class="menu-toggler linked" data-toggle="collapse"
                                           data-target="#modules-links"
                                   >
                                       <span class="fa fa-archive"></span>
                                       <span class="link-name">Modules</span>
                                       <span class="fa fa-angle-down"></span>
                                   </div>
                               </a>
                               <ul class="links collapse "
                                       id="modules-links"
                   >
                                       <li class="link">
                                           <a href="../modules/AppModule.html" >AppModule</a>
                                       </li>
                               </ul>
                           </li>
                   
                           <li class="chapter">
                               <div class="simple menu-toggler" data-toggle="collapse"
                                       data-target="#components-links"
                   >
                                   <span class="fa fa-cogs"></span>
                                   <span>Components</span>
                                   <span class="fa fa-angle-down"></span>
                               </div>
                               <ul class="links collapse "
                                       id="components-links"
                   >
                                       <li class="link">
                                           <a href="../components/AppComponent.html" >AppComponent</a>
                                       </li>
                                       <li class="link">
                                           <a href="../components/ArticleComponent.html" >ArticleComponent</a>
                                       </li>
                                       <li class="link">
                                           <a href="../components/HomeComponent.html" >HomeComponent</a>
                                       </li>
                                       <li class="link">
                                           <a href="../components/SearchComponent.html" >SearchComponent</a>
                                       </li>
                               </ul>
                           </li>
                   
                   
                           <li class="chapter">
                               <div class="simple menu-toggler" data-toggle="collapse"
                                       data-target="#classes-links"
                   >
                                   <span class="fa fa-file-code-o"></span>
                                   <span>Classes</span>
                                   <span class="fa fa-angle-down"></span>
                               </div>
                               <ul class="links collapse "
                                       id="classes-links"
                   >
                                       <li class="link">
                                           <a href="../classes/Article.html"  data-type="entity-link" class="active" >Article</a>
                                       </li>
                                       <li class="link">
                                           <a href="../classes/Column.html" >Column</a>
                                       </li>
                               </ul>
                           </li>
                   
                           <li class="chapter">
                               <div class="simple menu-toggler" data-toggle="collapse"
                                       data-target="#injectables-links"
                   >
                                   <span class="fa fa-long-arrow-down"></span>
                                   <span>Injectables</span>
                                   <span class="fa fa-angle-down"></span>
                               </div>
                               <ul class="links collapse "
                                       id="injectables-links"
                   >
                                       <li class="link">
                                           <a href="../injectables/AppService.html" >AppService</a>
                                       </li>
                                       <li class="link">
                                           <a href="../injectables/ArticleListService.html" >ArticleListService</a>
                                       </li>
                                       <li class="link">
                                           <a href="../injectables/SmarketHttpService.html" >SmarketHttpService</a>
                                       </li>
                               </ul>
                           </li>
                   
                   
                   
                   
                           <li class="chapter">
                               <div class="simple menu-toggler" data-toggle="collapse"
                                       data-target="#miscellaneous-links"
                   >
                                   <span class="fa fa-cubes"></span>
                                   <span>Miscellaneous</span>
                                   <span class="fa fa-angle-down"></span>
                               </div>
                               <ul class="links collapse "
                                       id="miscellaneous-links"
                   >
                                       <li class="link">
                                         <a href="../miscellaneous/variables.html" data-type="entity-link" >Variables</a>
                                       </li>
                               </ul>
                           </li>
                   
                           <li class="chapter">
                               <a data-type="chapter-link" href="../routes.html" ><span class="fa fa-code-fork"></span>Routes</a>
                           </li>
                   
                           <li class="chapter">
                               <a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
                           </li>
                   
                   
                       </ul>
                   
                   </nav>
               </div>
               <div class="content class">
                   <div class="content-data">









<ol class="breadcrumb">
  <li>Classes</li>
  <li>Article</li>
</ol>

<ul class="nav nav-tabs" role="tablist">
    <li class="active">
        <a href="#info" id="info-tab" role="tab" data-toggle="tab" data-link="info">Info</a>
    </li>


    <li>
        <a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a>
    </li>
</ul>

<div class="tab-content">
    <div class="tab-pane fade active in" id="c-info">
        <p class="comment">
            <h3>File</h3>
        </p>
        <p class="comment">
            <code>src/app/services/article-list.service.ts</code>
        </p>





            <section>
                <h3 id="index">Index</h3>
                <table class="table table-sm table-bordered index-table">
                    <tbody>
                        <tr>
                            <td class="col-md-4">
                                <h6><b>Properties</b></h6>
                            </td>
                        </tr>
                        <tr>
                            <td class="col-md-4">
                                <ul class="index-list">
                                    <li>
                                            <span class="modifier">Public</span>
                                        <a href="#articleId">articleId</a>
                                    </li>
                                    <li>
                                            <span class="modifier">Public</span>
                                        <a href="#createTime">createTime</a>
                                    </li>
                                    <li>
                                            <span class="modifier">Public</span>
                                        <a href="#title">title</a>
                                    </li>
                                </ul>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </section>

            <section>
                <h3 id="constructor">Constructor</h3>
                    <table class="table table-sm table-bordered">
                        <tbody>
                            <tr>
                                <td class="col-md-4">
                                    <code>constructor(articleId: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, title: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, createTime: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
                                </td>
                            </tr>
                                    <tr>
                                        <td class="col-md-4">
                                            <div class="io-line">Defined in <a href="" data-line="33" class="link-to-prism">src/app/services/article-list.service.ts:33</a></div>
                                        </td>
                                    </tr>
            
                            <tr>
                                <td class="col-md-4">
                                        <div>
                                                <b>Parameters :</b>
                                                <table class="params">
                                                    <thead>
                                                        <tr>
                                                            <td>Name</td>
                                                            <td>Type</td>
                                                            <td>Optional</td>
                                                            <td>Description</td>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                            <tr>
                                                              <td>articleId</td>
                                                              <td>
                                                                        <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
                                                              </td>
                                                              <td>
                                                              </td>
                                                              <td></td>
                                                            </tr>
                                                            <tr>
                                                              <td>title</td>
                                                              <td>
                                                                        <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
                                                              </td>
                                                              <td>
                                                              </td>
                                                              <td></td>
                                                            </tr>
                                                            <tr>
                                                              <td>createTime</td>
                                                              <td>
                                                                        <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
                                                              </td>
                                                              <td>
                                                              </td>
                                                              <td></td>
                                                            </tr>
                                                    </tbody>
                                                </table>
                                        </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
            </section>



            <section>
                
                    <h3 id="inputs">
                        Properties
                    </h3>
                    <table class="table table-sm table-bordered">
                        <tbody>
                            <tr>
                                <td class="col-md-4">
                                    <a name="articleId"></a>
                                    <span class="name">
                                        <b>
                                            <span class="modifier">Public</span>
                                        articleId
                                        </b>
                                        <a href="#articleId"><span class="fa fa-link"></span></a>
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td class="col-md-4">
                                    <span class="modifier-icon fa fa-reset"></span><code>articleId:     <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
            </code>
                                </td>
                            </tr>
                                <tr>
                                    <td class="col-md-4">
                                        <i>Type : </i>    <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
            
                                    </td>
                                </tr>
                                    <tr>
                                        <td class="col-md-4">
                                            <div class="io-line">Defined in <a href="" data-line="35" class="link-to-prism">src/app/services/article-list.service.ts:35</a></div>
                                        </td>
                                    </tr>
            
            
                        </tbody>
                    </table>
                    <table class="table table-sm table-bordered">
                        <tbody>
                            <tr>
                                <td class="col-md-4">
                                    <a name="createTime"></a>
                                    <span class="name">
                                        <b>
                                            <span class="modifier">Public</span>
                                        createTime
                                        </b>
                                        <a href="#createTime"><span class="fa fa-link"></span></a>
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td class="col-md-4">
                                    <span class="modifier-icon fa fa-reset"></span><code>createTime:     <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
            </code>
                                </td>
                            </tr>
                                <tr>
                                    <td class="col-md-4">
                                        <i>Type : </i>    <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
            
                                    </td>
                                </tr>
                                    <tr>
                                        <td class="col-md-4">
                                            <div class="io-line">Defined in <a href="" data-line="37" class="link-to-prism">src/app/services/article-list.service.ts:37</a></div>
                                        </td>
                                    </tr>
            
            
                        </tbody>
                    </table>
                    <table class="table table-sm table-bordered">
                        <tbody>
                            <tr>
                                <td class="col-md-4">
                                    <a name="title"></a>
                                    <span class="name">
                                        <b>
                                            <span class="modifier">Public</span>
                                        title
                                        </b>
                                        <a href="#title"><span class="fa fa-link"></span></a>
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td class="col-md-4">
                                    <span class="modifier-icon fa fa-reset"></span><code>title:     <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
            </code>
                                </td>
                            </tr>
                                <tr>
                                    <td class="col-md-4">
                                        <i>Type : </i>    <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
            
                                    </td>
                                </tr>
                                    <tr>
                                        <td class="col-md-4">
                                            <div class="io-line">Defined in <a href="" data-line="36" class="link-to-prism">src/app/services/article-list.service.ts:36</a></div>
                                        </td>
                                    </tr>
            
            
                        </tbody>
                    </table>
            </section>

    </div>


    <div class="tab-pane fade tab-source-code" id="c-source">
        <pre class="line-numbers"><code class="language-typescript">import {Injectable} from &#x27;@angular/core&#x27;;
import {SmarketHttpService} from &#x27;./smarket-http.service&#x27;;
import {Observable} from &#x27;rxjs/Observable&#x27;;

@Injectable()
export class ArticleListService {

  constructor(private smarketHttpService: SmarketHttpService) {
  }

  getArticleColumn(params: object): Observable&lt;(Article | Column)[]&gt; {
    return this.smarketHttpService.post(&#x27;articleCategory.search&#x27;, params).map(res &#x3D;&gt; {
      const _list: any[] &#x3D; res.content.items,
        list: (Column | Article)[] &#x3D; [];
      _list.forEach(item &#x3D;&gt; {
        if (item.hasOwnProperty(&#x27;articleCategoryId&#x27;)) {
          list.push(new Column(item.articleCategoryId, item.title, item.createTime, item.articleCount));
        } else if (item.hasOwnProperty(&#x27;articleId&#x27;)) {
          list.push(new Article(item.articleId, item.title, item.createTime));
        }
      });
      return list;
    });
  }

  addArticle(params: object): Observable&lt;boolean&gt; {
    return this.smarketHttpService.post(&#x27;article.create&#x27;, params).map(data &#x3D;&gt; {
      return data.result.toString() &#x3D;&#x3D;&#x3D; &#x27;0&#x27;;
    });
  }
}

export class Article {
  constructor(
    public articleId: string,
    public title: string,
    public createTime: string) {
  }
}

export class Column {
  constructor(
    public articleCategoryId: string,
    public title: string,
    public createTime: string,
    public articleCount: string) {
  }
}
</code></pre>
    </div>
</div>





                   </div><div class="search-results">
    <div class="has-results">
        <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
        <ul class="search-results-list"></ul>
    </div>
    <div class="no-results">
        <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
    </div>
</div>
</div>
           </div>
       </div>

       <script src="../js/libs/bootstrap-native.js"></script>

       <script src="../js/libs/es6-shim.min.js"></script>
       <script src="../js/libs/EventDispatcher.js"></script>
       <script src="../js/libs/promise.min.js"></script>
       <script src="../js/libs/zepto.min.js"></script>

       <script src="../js/compodoc.js"></script>

       <script>var COMPODOC_CURRENT_PAGE_DEPTH = 1;</script>

       <script src="../js/search/search.js"></script>
       <script src="../js/search/lunr.min.js"></script>
       <script src="../js/search/search-lunr.js"></script>

       <script src="../js/tabs.js"></script>
       <script src="../js/menu.js"></script>
       <script src="../js/libs/prism.js"></script>
       <script src="../js/sourceCode.js"></script>
       <script src="../js/search/search_index.js"></script>

    </body>
</html>
